/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PurgeRevision
/*    */   extends RedoableOp
/*    */ {
/*    */   protected int mId;
/*    */   protected int mRev;
/*    */   protected boolean mIncludeOlderRevisions;
/*    */   
/*    */   public PurgeRevision()
/*    */   {
/* 34 */     super(MailboxOperation.PurgeRevision);
/*    */   }
/*    */   
/*    */   public PurgeRevision(int mailboxId, int id, int rev, boolean includeOlderRevisions) {
/* 38 */     this();
/* 39 */     setMailboxId(mailboxId);
/* 40 */     this.mId = id;
/* 41 */     this.mRev = rev;
/* 42 */     this.mIncludeOlderRevisions = includeOlderRevisions;
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 46 */     StringBuffer sb = new StringBuffer("id=").append(this.mId);
/* 47 */     sb.append(", rev=").append(this.mRev);
/* 48 */     sb.append(", includeOlderRevisions=").append(this.mIncludeOlderRevisions);
/* 49 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 53 */     out.writeInt(this.mId);
/* 54 */     out.writeInt(this.mRev);
/* 55 */     out.writeBoolean(this.mIncludeOlderRevisions);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 59 */     this.mId = in.readInt();
/* 60 */     this.mRev = in.readInt();
/* 61 */     this.mIncludeOlderRevisions = in.readBoolean();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 65 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 66 */     mbox.purgeRevision(getOperationContext(), this.mId, this.mRev, this.mIncludeOlderRevisions);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/PurgeRevision.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */